<!--刷脸数据查询列表页-->
<template>
    <div style="height: 100%;">
        <m-page-list
                :option="option"
                :page="page"
                :total="total"
                :table-data="tableData"
                :table-loading="tableLoading"
                v-model:value="query"
                @h-btn-click="hBtnClick"
                @col-btn-click="colBtnClick"
                @search-data="searchData"
        />
        <m-dialog-form ref="dialogRef" :data="dialogData" v-model:show="dialogShow" :option="dialogOption" @confirm="dialogConfirm" ></m-dialog-form>
    </div>

</template>

<script setup>

  import {ref,reactive,onMounted,nextTick} from 'vue'
  //组件
  import MPageList from '@/components/PageList'
  import MDialogForm from '@/components/DialogForm/DialogForm'
  //请求
  import {getFaceRecognition, addStop,editStop,delStop} from '@/request/api/basicData'

  import {usePageList} from "../../composables/pageList";

  let opts = {
    // auth_id: 'stop',
    getApi: getFaceRecognition,addApi:addStop,editApi:editStop,delApi:delStop,
    idKey: 'stop_id'
  };
  let {option,page,total,tableLoading,tableData,query,dialogRef,dialogShow,dialogData,dialogOption,
    hBtnClick,colBtnClick,searchData,getDataList,dialogConfirm} = usePageList(opts);

  option.hLBtns = [];
  option.colBtns = [];

  option.conditions = [
    {label: '终端编号',type: 'text',field_id: 'terminal_no',col: 12},
    {label: '遮挡类型',type: 'picklist',field_id: 'mouth_occ_status',col: 12,options: [
        {name: '无遮挡',id: '0'},
        {name: '口罩遮挡',id: '1'},
        {name: '其他遮挡',id: '3'},
      ]},
  ];
  option.cols = [
    {prop: 'merCode', label: '商户号',},
    {prop: 'terminalNo', label: '终端号',},
    {prop: 'faceToken', label: '人脸特征唯一值',},
    {prop: 'searchScore', label: '相似度分值',},
    {prop: 'userId',label: '用户ID',},
    {prop: 'livenessScore',label: '活性分值' },
    {prop: 'tem',label: '体温' },
    {prop: 'payAmount',label: '支付金额' },
    {prop: 'mouthOccStatus',label: '遮挡类型',templte: (scope) =>{
        let row = scope.row,
          {mouthOccStatus} = row,
          type = mouthOccStatus == 3 ? '其他遮挡' : mouthOccStatus == 1 ? '口罩遮挡' : '无遮挡';
        return `<div>${type}</div>`;
      } },
    {prop: 'longitude',label: '经度' },
    {prop: 'latitude',label: '纬度' },
    {prop: 'bearing',label: '方向' },
    {prop: 'rgbImage',label: '图像的raw数据' },
    {prop: 'input_id',label: '录入员号' },
    {prop: 'input_name',label: '录入员名' },
    {prop: 'input_time',label: '录入时间' },
    {prop: 'modify_id',label: '修改员号' },
    {prop: 'modify_name',label: '修改员名' },
    {prop: 'modify_time',label: '修改时间' },
  ];
  /*dialogOption.fieldList = [
    {field_id: 'stop_id',label: '站点编号',type: 'text',col: 2 ,editDisabled: true,required: true },
    {field_id: 'stop_name',label: '站点名称',type: 'text',col: 2 ,required: true },
    {field_id: 'longitude',label: '经度',type: 'number',col: 2 },
    {field_id: 'latitude',label: '纬度',type: 'number',col: 2  },
    {field_id: 'pictures_link',label: '图片',type: 'picture',limit: 1,col: 4 ,required: false },
    {field_id: 'is_used',label: '使用标识',type: 'bool',col: 2  },
  ];*/

</script>

